from django.conf.urls import url
from django.urls import include
from rest_framework.routers import DefaultRouter

from .views import UsernameCountView, MobileCountView, UserViewset, SMSCodeTokenViewset, ResetPwdView

router = DefaultRouter()
router.register(r'', UserViewset, basename="users")
router.register(r'smsCodeToken', SMSCodeTokenViewset, basename="smsCodeToken")

urlpatterns = [
    url(r"^", include(router.urls)),
    url(r'^usernameCount', UsernameCountView.as_view(), name="usernameCount"),
    url(r'^mobileCount', MobileCountView.as_view(), name="mobileCount"),
    url(r"^resetPwd", ResetPwdView.as_view(), name="resetPwd")
]
